package orthoplanner.com.google.code.ui;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;

public class MainFrame {
	private JFrame mainFrame;
	private JPanel leftPanel, rightPanel;

	public MainFrame(int width, int height) {
		try {
			UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
		} catch (Exception e) {
			e.printStackTrace();
		}
		mainFrame = new JFrame("Gaia::An open source solution by Smonks");
		leftPanel = new JPanel();
		rightPanel = new JPanel();
		leftPanel.setMinimumSize(new Dimension(50, 300));
		leftPanel.setPreferredSize(new Dimension(50, 300));

		leftPanel.setBorder(BorderFactory.createBevelBorder(1, Color.black,
				Color.gray));

		// rightPanel.setPreferredSize(new Dimension(300,300));

		rightPanel.setBorder(BorderFactory.createBevelBorder(1, Color.red,
				Color.red));

		mainFrame.setPreferredSize(new Dimension(width, height));
		mainFrame.setMinimumSize(new Dimension(width, height));

		mainFrame.getContentPane().setLayout(new GridBagLayout());
		GridBagConstraints gbc = new GridBagConstraints();
		gbc.anchor = GridBagConstraints.FIRST_LINE_START;
		gbc.weighty = 1.0;
		mainFrame.getContentPane().add(leftPanel, gbc);
		gbc.gridx = 1;
		gbc.weighty = 1.0;
		gbc.weightx = 1.0;
		gbc.fill = GridBagConstraints.BOTH;
		mainFrame.getContentPane().add(rightPanel, gbc);
		mainFrame.pack();
		mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		mainFrame.setVisible(true);
	}
}
